package com.js.lib_common.base;

import android.os.Bundle;



public abstract class MvpActivity<P extends BasePresenter> extends BaseActivity {
    protected P mvpPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mvpPresenter = createPresenter();

    }

    protected abstract P createPresenter();

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mvpPresenter != null) {
            mvpPresenter.detachView();
        }

    }



    public void showLoading() {
        showLoadingDialog();
    }

    public void hideLoading() {
        dismissLoadingDialog();
    }


}
